package com.greyu.ysj.utils;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;

public class MyClient {
	private OkHttpClient.Builder client;
	private MyClient() {
		client = new OkHttpClient.Builder();
		client.readTimeout(50000, TimeUnit.MILLISECONDS);
		client.writeTimeout(50000, TimeUnit.MILLISECONDS);
		client.connectTimeout(50000, TimeUnit.MILLISECONDS);
	}

	private static class SingletonHolder {
		private final static MyClient instance = new MyClient();
	}

	public static MyClient getInstance() {
		return SingletonHolder.instance;
	}
	public OkHttpClient getClient() {
		return client.build();
	}
}
